\(\int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx\) [658]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (warning: unable to verify)
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 26, antiderivative size = 60 \[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=-\frac {2 i a \sqrt {e \cos (c+d x)}}{d}+\frac {2 a \sqrt {e \cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d \sqrt {\cos (c+d x)}} \]

[Out]

-2*I*a*(e*cos(d*x+c))^(1/2)/d+2*a*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+1/2*c)
,2^(1/2))*(e*cos(d*x+c))^(1/2)/d/cos(d*x+c)^(1/2)

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3596, 3567, 3856, 2719} \[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {2 a E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {e \cos (c+d x)}}{d \sqrt {\cos (c+d x)}}-\frac {2 i a \sqrt {e \cos (c+d x)}}{d} \]

[In]

Int[Sqrt[e*Cos[c + d*x]]*(a + I*a*Tan[c + d*x]),x]

[Out]

((-2*I)*a*Sqrt[e*Cos[c + d*x]])/d + (2*a*Sqrt[e*Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2])/(d*Sqrt[Cos[c + d*x]]
)

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3596

Int[(cos[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(d*Co
s[e + f*x])^m*(d*Sec[e + f*x])^m, Int[(a + b*Tan[e + f*x])^n/(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e,
f, m, n}, x] &&  !IntegerQ[m]

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rubi steps \begin{align*} \text {integral}& = \left (\sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}\right ) \int \frac {a+i a \tan (c+d x)}{\sqrt {e \sec (c+d x)}} \, dx \\ & = -\frac {2 i a \sqrt {e \cos (c+d x)}}{d}+\left (a \sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}\right ) \int \frac {1}{\sqrt {e \sec (c+d x)}} \, dx \\ & = -\frac {2 i a \sqrt {e \cos (c+d x)}}{d}+\frac {\left (a \sqrt {e \cos (c+d x)}\right ) \int \sqrt {\cos (c+d x)} \, dx}{\sqrt {\cos (c+d x)}} \\ & = -\frac {2 i a \sqrt {e \cos (c+d x)}}{d}+\frac {2 a \sqrt {e \cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{d \sqrt {\cos (c+d x)}} \\ \end{align*}

Mathematica [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.

Time = 3.68 (sec) , antiderivative size = 192, normalized size of antiderivative = 3.20 \[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {a \cos (c) \sqrt {e \cos (c+d x)} \sin (c) (\cos (d x)-i \sin (d x)) \left (\, _2F_1\left (-\frac {1}{2},-\frac {1}{4};\frac {3}{4};\cos ^2(d x+\arctan (\tan (c)))\right ) (-i \csc (c)-\sec (c)) \sec (c) \sin (d x+\arctan (\tan (c)))+\sqrt {\sin ^2(d x+\arctan (\tan (c)))} \left (2 \cos (d x+\arctan (\tan (c))) \csc (c) (i \csc (c)+\sec (c))+\sec (c) \left (-2 i \cos (c+d x) \csc ^2(c) \sqrt {\sec ^2(c)}+(i \csc (c)+\sec (c)) \sin (d x+\arctan (\tan (c)))\right )\right )\right ) (-i+\tan (c+d x))}{d \sqrt {\sec ^2(c)} \sqrt {\sin ^2(d x+\arctan (\tan (c)))}} \]

[In]

Integrate[Sqrt[e*Cos[c + d*x]]*(a + I*a*Tan[c + d*x]),x]

[Out]

(a*Cos[c]*Sqrt[e*Cos[c + d*x]]*Sin[c]*(Cos[d*x] - I*Sin[d*x])*(HypergeometricPFQ[{-1/2, -1/4}, {3/4}, Cos[d*x
+ ArcTan[Tan[c]]]^2]*((-I)*Csc[c] - Sec[c])*Sec[c]*Sin[d*x + ArcTan[Tan[c]]] + Sqrt[Sin[d*x + ArcTan[Tan[c]]]^
2]*(2*Cos[d*x + ArcTan[Tan[c]]]*Csc[c]*(I*Csc[c] + Sec[c]) + Sec[c]*((-2*I)*Cos[c + d*x]*Csc[c]^2*Sqrt[Sec[c]^
2] + (I*Csc[c] + Sec[c])*Sin[d*x + ArcTan[Tan[c]]])))*(-I + Tan[c + d*x]))/(d*Sqrt[Sec[c]^2]*Sqrt[Sin[d*x + Ar
cTan[Tan[c]]]^2])

Maple [A] (verified)

Time = 4.26 (sec) , antiderivative size = 108, normalized size of antiderivative = 1.80

method result size
default \(\frac {2 a e \left (2 i \left (\sin ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right ) \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}-i \sin \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) e +e}\, d}\) \(108\)
parts \(\frac {2 a \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right ) \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}\, e \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {-2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+1}\, E\left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )}{\sqrt {-e \left (2 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}\, \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {e \left (2 \left (\cos ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1\right )}\, d}-\frac {2 i a \sqrt {e \cos \left (d x +c \right )}}{d}\) \(161\)
risch \(-\frac {2 i \sqrt {2}\, a \sqrt {e \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) {\mathrm e}^{-i \left (d x +c \right )}}}{d}-\frac {i \left (-\frac {2 \left (e \,{\mathrm e}^{2 i \left (d x +c \right )}+e \right )}{e \sqrt {{\mathrm e}^{i \left (d x +c \right )} \left (e \,{\mathrm e}^{2 i \left (d x +c \right )}+e \right )}}+\frac {i \sqrt {-i \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}\, \sqrt {2}\, \sqrt {i \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}\, \sqrt {i {\mathrm e}^{i \left (d x +c \right )}}\, \left (-2 i E\left (\sqrt {-i \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}, \frac {\sqrt {2}}{2}\right )+i F\left (\sqrt {-i \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}, \frac {\sqrt {2}}{2}\right )\right )}{\sqrt {e \,{\mathrm e}^{3 i \left (d x +c \right )}+e \,{\mathrm e}^{i \left (d x +c \right )}}}\right ) \sqrt {2}\, a \sqrt {e \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) {\mathrm e}^{-i \left (d x +c \right )}}\, \sqrt {e \,{\mathrm e}^{i \left (d x +c \right )} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}\) \(301\)

[In]

int((e*cos(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

2/sin(1/2*d*x+1/2*c)/(-2*sin(1/2*d*x+1/2*c)^2*e+e)^(1/2)*a*e*(2*I*sin(1/2*d*x+1/2*c)^3+EllipticE(cos(1/2*d*x+1
/2*c),2^(1/2))*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*(sin(1/2*d*x+1/2*c)^2)^(1/2)-I*sin(1/2*d*x+1/2*c))/d

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.08 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.45 \[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=\frac {2 i \, \sqrt {2} a \sqrt {e} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, e^{\left (i \, d x + i \, c\right )}\right )\right )}{d} \]

[In]

integrate((e*cos(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

2*I*sqrt(2)*a*sqrt(e)*weierstrassZeta(-4, 0, weierstrassPInverse(-4, 0, e^(I*d*x + I*c)))/d

Sympy [F]

\[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=i a \left (\int \left (- i \sqrt {e \cos {\left (c + d x \right )}}\right )\, dx + \int \sqrt {e \cos {\left (c + d x \right )}} \tan {\left (c + d x \right )}\, dx\right ) \]

[In]

integrate((e*cos(d*x+c))**(1/2)*(a+I*a*tan(d*x+c)),x)

[Out]

I*a*(Integral(-I*sqrt(e*cos(c + d*x)), x) + Integral(sqrt(e*cos(c + d*x))*tan(c + d*x), x))

Maxima [F]

\[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=\int { \sqrt {e \cos \left (d x + c\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )} \,d x } \]

[In]

integrate((e*cos(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

integrate(sqrt(e*cos(d*x + c))*(I*a*tan(d*x + c) + a), x)

Giac [F]

\[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=\int { \sqrt {e \cos \left (d x + c\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )} \,d x } \]

[In]

integrate((e*cos(d*x+c))^(1/2)*(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

integrate(sqrt(e*cos(d*x + c))*(I*a*tan(d*x + c) + a), x)

Mupad [F(-1)]

Timed out. \[ \int \sqrt {e \cos (c+d x)} (a+i a \tan (c+d x)) \, dx=\int \sqrt {e\,\cos \left (c+d\,x\right )}\,\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right ) \,d x \]

[In]

int((e*cos(c + d*x))^(1/2)*(a + a*tan(c + d*x)*1i),x)

[Out]

int((e*cos(c + d*x))^(1/2)*(a + a*tan(c + d*x)*1i), x)